package com.fenghongzhang.kuaishou.index.home.adapter;

import android.util.Log;
import android.view.View;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fenghongzhang.kuaishou.R;
import com.fenghongzhang.kuaishou.index.home.entity.VideoBean;

import java.util.List;

/**
 * 关注fragment的内容适配器
 */
public class AttentFragmentAdapter extends BaseQuickAdapter<VideoBean, BaseViewHolder> {

    public AttentFragmentAdapter(int layoutResId, @Nullable List<VideoBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, VideoBean item) {
        ImageView imageView = helper.getView(R.id.attent_recycler_index_image);
        ImageView titleImageView = helper.getView(R.id.attent_recycler_title_image);
        Log.i(TAG, "convert: "+item.getCoverImg());
        Glide.with(mContext).load(item.getCoverImg()).into(imageView);
        Glide.with(mContext).load(item.getCoverImg()).apply(new RequestOptions().circleCrop()).into(titleImageView);
        helper.addOnClickListener(R.id.attent_recycler_index_image);
        helper.addOnClickListener(R.id.attent_recycler_title_image);
    }

}
